<?php
    @include_once("config.php");

    $goodsid = $_GET["id"];

    $sql  = "select  * from  productsinfo  where id =$goodsid";

    $result  = mysql_query($sql);//id是主键  是唯一的

    $item = mysql_fetch_array($result);

    $obj=  array();

    $obj["id"]= $item["id"];
    $obj["goodsname"]=$item["goodsname"];
    $obj["goodsnum"]=$item["goodsnum"];
    $obj["goodsprice"]= $item["goodsprice"];
    $obj["smallimg"]=$item["goodssmallimg"];
    $obj["bigimg"]=$item["goodsbigimg"];

    echo json_encode($obj);
?>